import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css';
import { createPinia } from 'pinia'
// Import Font Awesome CSS
import '@fortawesome/fontawesome-free/css/all.css'


const app = createApp(App)
// 定义一个名为 'focus' 的自定义指令
app.directive('focus', {
  mounted(el) {
    el.focus();
  }
});
// 注册 pinia
const pinia = createPinia()
app.use(pinia)
// 使用路由
app.use(router)
// 挂载app
app.mount('#app')

app.config.productionTip = false
app.use(ElementPlus);
// 全局图标注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}